package com.xhu.servlet;

import com.xhu.service.CountService;
import com.xhu.service.impl.CountServiceImpl;
import com.xhu.utils.BaseServlet;
import com.xhu.utils.ResultData;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@WebServlet("/countServlet/*")
public class CountServlet extends BaseServlet {
    public ResultData countNumber(HttpServletRequest request){
        //固定去统计数据
        CountService countService=new CountServiceImpl();
        Map<String,Object> map=countService.countNumber();
        return   map.size()>0?ResultData.ok().data(map):ResultData.error().msg("没有数据");
    }

}
